"use strict";
//定义一个接口
// function getInfo(firstName:string,lastName:string,age:number):string{
// }
function getInfo(info) {
    let { firstName, lastName, age } = info;
    if (age) {
        return `${firstName}${lastName}${age}`;
    }
    return `${firstName}${lastName}`;
}
console.log(getInfo({ firstName: 'zs', lastName: 'zhang', age: 19, address: '北京', idCard: '1221112' }));
// function compareFun(num1:number,num2:number):boolean{
//     return num1>num2
// }
// let compareFun:CompareInterface = function(num1:number,num2:number):boolean{
//     return num1>num2
// }
let compareFun = function (num1, num2) {
    return num1 > num2;
};
console.log(compareFun(11, 2));
class Dog {
    constructor(name) {
        this.name = name;
    }
    eat(str) {
        console.log(this.name + '吃' + str);
    }
}
let d1 = new Dog('藏獒');
d1.eat('肉');
class Cat {
    constructor(name) {
        this.name = name;
    }
    eat(str) {
        console.log(this.name + '吃' + str);
    }
}
let c1 = new Dog('无毛猫');
c1.eat('鱼');
